/**
 * 
 */ 
package com.tueye.service.impl.usermanager; 

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.tueye.base.util.Page;
import com.tueye.dao.usermanager.IUserTopicManagerDao;
import com.tueye.entity.Pictures;
import com.tueye.entity.user.UserCollectionInfo;
import com.tueye.service.exception.TuEyeServiceException;
import com.tueye.service.usermanager.IUserTopicManager;
import com.tueye.web.controller.blog.PagerModel;

/** 
 * @author 作者 yuyue E-mail: z_yuguangyue@126.com
 * @version 创建时间：Mar 26, 2009 7:28:55 PM 
 * Title:
 * Description:
 * ChangeDate:Mar 26, 2009 7:28:55 PM 
 * @ see 
 */
 
@Scope("prototype")
@Component("userTopicManger")
public class UserTopicManger implements IUserTopicManager {

	@Autowired
	@Qualifier("userTopicMangerDao")
	private IUserTopicManagerDao  userTopicMangerDao;
	
	
	@Override
	public PagerModel getAllTopicByUserId(String hql, int currentPage, int pageSize) {
		// TODO Auto-generated method stub
	 Page page = userTopicMangerDao.getAllTopicByUserId(hql, currentPage, pageSize);
	 PagerModel pm = new PagerModel(); 
	 pm.setTotal(page.getTotalCount());
	 pm.setDatas((List<Pictures>)page.getResult()); 
	  return pm;
	}


	@Override
	public List getOneTopicByAll(String topicid, String userId)
			throws TuEyeServiceException {
		// TODO Auto-generated method stub
		return userTopicMangerDao.getOneTopicByAll(topicid,userId);
	}


	@Override
	public void saveShouCang(UserCollectionInfo ui)
			throws TuEyeServiceException {
		// TODO Auto-generated method stub
		userTopicMangerDao.saveShouCang(ui);
	}


	@Override
	public void delcollect(String userId, String topicid) {
		// TODO Auto-generated method stub
		userTopicMangerDao.delcollect(userId,topicid);
	}
 

//	@Override
//	public Page getAllTopicByUserId(String userid) {
//		// TODO Auto-generated method stub
//		return null;
//	}

	
	
}
 